package com.piesat.quake.business.device.model;

import com.piesat.quake.business.device.mqtt.anno.CharField;
import com.piesat.quake.business.device.mqtt.anno.PipelineNode;

/**
 * 地震仪更新报文
 * 设备下行 QoS2
 * @author Gersy
 * @date 2023/2/14
 * @since 1.0
 */
@PipelineNode(preNodes = {BaseModel.class})
public class DeviceUpdate extends BaseModel {
    //类型标识	Char	2B	字符串内容为uc
    //软件名称	Char	16B	需要更新的软件名称
    @CharField(2)
    private String supplier;
    @CharField(16)
    private String name;
    //软件版本	Char	8B	需要更新的软件版本
    @CharField(8)
    private String version;

    public DeviceUpdate() {
        super("uc");
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public String getSupplier() {
        return supplier;
    }

    public void setSupplier(String supplier) {
        this.supplier = supplier;
    }

    @Override
    public String toString() {
        return "DeviceUpdate{" +
                "supplier='" + supplier + '\'' +
                ", name='" + name + '\'' +
                ", version='" + version + '\'' +
                ", type='" + type + '\'' +
                ", length=" + length +
                ", id='" + id + '\'' +
                ", endian=" + endian +
                ", timestamp=" + timestamp +
                '}';
    }
}
